package designpattern.command;

/**
 * TODO:类描述
 *
 * @className: Control
 * @packageName: designpattern.command
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/21 20:02
 */
public class Control {
    Command onCommad,offCommand,changeChlCommand;
    public Control(Command onCommad,Command offCommand,Command changeChlCommand){
        this.onCommad = onCommad;
        this.offCommand =offCommand;
        this.changeChlCommand = changeChlCommand;
    }
    public void turnOn(){
        onCommad.execute();
    }
    public void turnOff(){
        offCommand.execute();
    }
    public void changeChannel(){
        changeChlCommand.execute();
    }
}
